package com.hewl.business.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.hewl.business.entity.City;
import com.hewl.business.service.CityService;

@RestController
public class CityRestController {
    @Autowired
    private CityService cityService;

    @GetMapping("/api/city")
    public City findOneCity(@RequestParam(value = "cityName", required = true) String cityName) {
        return cityService.findCityByName(cityName);
    }
}
